package com.woniuxy.consumer;

import com.woniuxy.entity.Personrecord;
import com.woniuxy.service.PersonrecordService;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(consumerGroup = "woniu_personrecord",topic = "personday")
public class PersonRecordConsumer implements RocketMQListener<Personrecord> {
    @Autowired
    private PersonrecordService personrecordService;
    @Override
    public void onMessage(Personrecord personrecord) {
        personrecordService.save(personrecord);
    }
}
